#ifndef TEST_ECHO_SERVER_H_
#define TEST_ECHO_SERVER_H_

#include "base/base.h"

#include "net/processor.h"

namespace net {
class Poller;
class TcpServer;
//class Processor;
}

class EchoServerProcessor : public net::Processor {
  public:
    EchoServerProcessor() {
    }

    void HandleRead(net::TcpStream* stream, net::Buffer* buffer);
    void HandleWrite(net::TcpStream* stream, net::Buffer* buffer);

  private:

    DISALLOW_COPY_AND_ASSIGN(EchoServerProcessor);
};

class EchoServer {
  public:
    EchoServer(net::Poller* poller, const std::string& ip, uint16 port);

    void Start();

  private:
    scoped_ptr<net::TcpServer> tcp_server_;

    DISALLOW_COPY_AND_ASSIGN(EchoServer);
};

#endif
